#include "UserIdentityFormImpl.h"
#include "P2PChat.h"

UserIdentityFormImpl::UserIdentityFormImpl()
{
	ui.setupUi(this);
	
	/* Centering the gui and show */
	QDesktopWidget *dw = new QDesktopWidget();
	QRect geometry = dw->screenGeometry();
	setGeometry((geometry.width() / 2) - 170, (geometry.height() / 2) - 105, 340, 210);

	/* Start routin that define connections */
	setConnections();
}

void UserIdentityFormImpl::setConnections()
{
	connect(ui.saveIdentityButton, SIGNAL(clicked()), this, SLOT(saveIdentity()));
}

void UserIdentityFormImpl::saveIdentity()
{
	hide();
	P2PChat::getInstance()->saveIdentity();
}
